package com.wefans.wefansapp.common.tool.popup;

import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.wefans.wefansapp.R;

public class FindPasswordDialog extends BaseDialog {

	private Button mBtnClose = null;
	private EditText mEtEmail = null;
	private Button mBtnSendTempPassword = null;	
	
	private OnFindPasswordListener mFindPasswordListener = null;
	
	public interface OnFindPasswordListener {
		void onFindPassword(String strEmail);		
	}
	
	public FindPasswordDialog(Context mContext, OnFindPasswordListener findPasswordListener) {
		super(mContext);
		
		setContentView(R.layout.dialog_find_password);
		
		mBtnClose = (Button)findViewById(R.id.BTN_DIALOG_CLOSE);
		mEtEmail = (EditText)findViewById(R.id.ET_EMAIL);
		mBtnSendTempPassword = (Button)findViewById(R.id.BTN_SEND_TEMP_PASSWORD);		
		
		mFindPasswordListener = findPasswordListener;
		mBtnClose.setOnClickListener(onClickListener);
		mBtnSendTempPassword.setOnClickListener(onClickListener);
	}

	android.view.View.OnClickListener onClickListener = new android.view.View.OnClickListener() {
		
		public void onClick(View v) {
			
			switch (v.getId()) {
			case R.id.BTN_SEND_TEMP_PASSWORD:
				if (mFindPasswordListener != null) {
					mFindPasswordListener.onFindPassword(mEtEmail.getText().toString());
				}
				dismiss();
				break;
			case R.id.BTN_DIALOG_CLOSE:
				dismiss();
				break;
			}
		}
	};

}
